#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int num[5],n;
string s;

int js(int egg_number, int backet) {
    if (egg_number < backet) backet = egg_number;
    if (backet == 1 || backet == 0) return 1;
    if (egg_number == 0) return 0;
    return js(egg_number-backet, backet)
           + js(egg_number, backet-1);
}

void read(){
	int cnt=1,tmp=0;
	char c;
	for(int i=0;i<s.size();i++){
		c=s[i];
		if(c==','){
			num[cnt++]=tmp;
			tmp=0;
		}else if((c-'0')>=0 && (c-'0')<=9){
			tmp=tmp*10+c-'0';
		}
	}
	num[cnt]=tmp;
	n=cnt;
}

int main() {
	while(cin>>s){
		read();
        cout<<js(num[1],num[2])<<endl;
	}
    return 0;
}



